
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>14. 用户交互界面（GUI） · Harbinger</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="https://github.com/TeamCovertDragon/Harbinger/graphs/contributors">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-katex/katex.min.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../chapter-15/" />
    
    
    <link rel="prev" href="../chapter-13/text-component.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        <li class="header">总目录</li>
        
        
    

    
        
        <li class="header">前言</li>
        
        
    
        <li class="chapter " data-level="2.1" >
            
                <span>
            
                    
                    前言
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="../">
            
                <a href="../">
            
                    
                    写在前面：这是什么？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="../preface/">
            
                <a href="../preface/">
            
                    
                    序：《异教与隐士》
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">正文</li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="../chapter-01/">
            
                <a href="../chapter-01/">
            
                    
                    1. 站在巨人的肩膀上
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1.1" data-path="../chapter-01/mcp.html">
            
                <a href="../chapter-01/mcp.html">
            
                    
                    1.1 MCP
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.2" data-path="../chapter-01/forge.html">
            
                <a href="../chapter-01/forge.html">
            
                    
                    1.2 Forge
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.1.3" data-path="../chapter-01/forgegradle.md">
            
                <span>
            
                    
                    1.3 ForgeGradle
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="../chapter-02/">
            
                <a href="../chapter-02/">
            
                    
                    2. 一切的开始
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.2.1" data-path="../chapter-02/metadata.html">
            
                <a href="../chapter-02/metadata.html">
            
                    
                    2.1 Mod 元数据
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="../chapter-03/">
            
                <a href="../chapter-03/">
            
                    
                    3. 事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="../chapter-04/">
            
                <a href="../chapter-04/">
            
                    
                    4. 物品
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.4.1" data-path="../chapter-04/item-stack.html">
            
                <a href="../chapter-04/item-stack.html">
            
                    
                    4.1 ItemStack
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.4.2" data-path="../chapter-04/advanced/">
            
                <a href="../chapter-04/advanced/">
            
                    
                    4.2 物品进阶
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.4.2.1" data-path="../chapter-04/advanced/meta-hack.html">
            
                <a href="../chapter-04/advanced/meta-hack.html">
            
                    
                    4.2.1 Meta-hack
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.4.2.2" data-path="../chapter-04/advanced/food.html">
            
                <a href="../chapter-04/advanced/food.html">
            
                    
                    4.2.2 食物
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.4.2.3" data-path="../chapter-04/advanced/tool.html">
            
                <a href="../chapter-04/advanced/tool.html">
            
                    
                    4.2.3 工具及武器等
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.4.2.4" data-path="../chapter-04/advanced/armor.html">
            
                <a href="../chapter-04/advanced/armor.html">
            
                    
                    4.2.4 护甲
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.4.2.5" data-path="../chapter-04/advanced/throwable.html">
            
                <a href="../chapter-04/advanced/throwable.html">
            
                    
                    4.2.5 投掷物
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="../chapter-05/">
            
                <a href="../chapter-05/">
            
                    
                    5. 方块
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.5.1" data-path="../chapter-05/block-state.html">
            
                <a href="../chapter-05/block-state.html">
            
                    
                    5.1 方块状态
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.5.2" >
            
                <span>
            
                    
                    5.2 高级的方块
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.5.2.1" data-path="../chapter-05/advanced/ore.html">
            
                <a href="../chapter-05/advanced/ore.html">
            
                    
                    5.2.1 矿石
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.5.2.2" data-path="../chapter-05/advanced/crop.html">
            
                <a href="../chapter-05/advanced/crop.html">
            
                    
                    5.2.2 作物
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.5.2.3" data-path="../chapter-05/advanced/sapling.html">
            
                <a href="../chapter-05/advanced/sapling.html">
            
                    
                    5.2.3 树苗
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.5.2.4" data-path="../chapter-05/advanced/redstone-sensitive.html">
            
                <a href="../chapter-05/advanced/redstone-sensitive.html">
            
                    
                    5.2.4 红石信号敏感的方块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.5.2.5" data-path="../chapter-05/advanced/air-like.html">
            
                <a href="../chapter-05/advanced/air-like.html">
            
                    
                    5.2.5 类似空气的方块
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.5.3" data-path="../chapter-05/block-drop.html">
            
                <a href="../chapter-05/block-drop.html">
            
                    
                    5.3 掉落概论
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="../chapter-06/">
            
                <a href="../chapter-06/">
            
                    
                    6. 注册表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="../chapter-07/">
            
                <a href="../chapter-07/">
            
                    
                    7. 物理端、逻辑端与网络 IO
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.7.1" data-path="../chapter-07/tile-entity-sync.html">
            
                <a href="../chapter-07/tile-entity-sync.html">
            
                    
                    7.1 TileEntity 内建的解决方案
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.7.2" data-path="../chapter-07/container-sync.md">
            
                <span>
            
                    
                    7.2 Container 内建的解决方案
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.7.3" data-path="../chapter-07/entity-sync.html">
            
                <a href="../chapter-07/entity-sync.html">
            
                    
                    7.3 实体的解决方案
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.7.4" >
            
                <span>
            
                    
                    7.4 Forge 的扩展
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.7.4.1" data-path="../chapter-07/forge-extension/simple-network-wrapper.html">
            
                <a href="../chapter-07/forge-extension/simple-network-wrapper.html">
            
                    
                    7.4.1 SimpleNetworkWrapper
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.7.4.2" data-path="../chapter-07/forge-extension/fml-event-channel.html">
            
                <a href="../chapter-07/forge-extension/fml-event-channel.html">
            
                    
                    7.4.2 FMLEventChannel
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="../chapter-08/">
            
                <a href="../chapter-08/">
            
                    
                    8. 实体
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="../chapter-09/">
            
                <a href="../chapter-09/">
            
                    
                    9. 方块实体（TileEntity）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.9.1" data-path="../chapter-09/examples/">
            
                <a href="../chapter-09/examples/">
            
                    
                    9.1 实例
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.9.1.1" data-path="../chapter-09/examples/inventory.html">
            
                <a href="../chapter-09/examples/inventory.html">
            
                    
                    9.1.1 箱子，或别的种类的物品容器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.9.1.2" data-path="../chapter-09/examples/tank.md">
            
                <span>
            
                    
                    9.1.2 流体储罐
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.9.1.3" data-path="../chapter-09/examples/grinder.md">
            
                <span>
            
                    
                    9.1.3 打粉机
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="../chapter-10/">
            
                <a href="../chapter-10/">
            
                    
                    10. 附魔
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.11" data-path="../chapter-11/">
            
                <a href="../chapter-11/">
            
                    
                    11. 渲染概论
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.11.1" data-path="../chapter-11/baked/">
            
                <a href="../chapter-11/baked/">
            
                    
                    11.1 方块及物品模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.11.1.1" data-path="../chapter-11/baked/custom-mesh.html">
            
                <a href="../chapter-11/baked/custom-mesh.html">
            
                    
                    11.1.1 自定义物品模型映射
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.11.1.2" data-path="../chapter-11/baked/tint.md">
            
                <span>
            
                    
                    11.1.2 染色
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.11.2" data-path="../chapter-11/custom-baked/">
            
                <a href="../chapter-11/custom-baked/">
            
                    
                    11.2 自定义模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.11.2.1" data-path="../chapter-11/custom-baked/baked.html">
            
                <a href="../chapter-11/custom-baked/baked.html">
            
                    
                    11.2.1 IBakedModel
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.11.2.2" data-path="../chapter-11/custom-baked/unbaked.html">
            
                <a href="../chapter-11/custom-baked/unbaked.html">
            
                    
                    11.2.2 IModel
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.11.2.3" data-path="../chapter-11/custom-baked/loader.html">
            
                <a href="../chapter-11/custom-baked/loader.html">
            
                    
                    11.2.3 ICustomModelLoader
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.11.2.4" data-path="../chapter-11/custom-baked/item-override.html">
            
                <a href="../chapter-11/custom-baked/item-override.html">
            
                    
                    11.2.4 ItemOverrideList
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.11.3" data-path="../chapter-11/entity-model/">
            
                <a href="../chapter-11/entity-model/">
            
                    
                    11.3 实体模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.11.3.1" data-path="../chapter-11/entity-model/encapsulated-model.html">
            
                <a href="../chapter-11/entity-model/encapsulated-model.html">
            
                    
                    11.3.1 ModelBase
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.11.3.2" data-path="../chapter-11/entity-model/events.html">
            
                <a href="../chapter-11/entity-model/events.html">
            
                    
                    11.3.2 相关事件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.11.4" data-path="../chapter-11/tesr.html">
            
                <a href="../chapter-11/tesr.html">
            
                    
                    11.4 TESR
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.11.5" data-path="../chapter-11/render-layer.md">
            
                <span>
            
                    
                    11.5 Render Layer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.11.6" data-path="../chapter-11/forge-extension/">
            
                <a href="../chapter-11/forge-extension/">
            
                    
                    11.6 Forge 的扩展
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.11.6.1" data-path="../chapter-11/forge-extension/forge-v1.html">
            
                <a href="../chapter-11/forge-extension/forge-v1.html">
            
                    
                    11.6.1 Forge BlockState V1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.11.6.2" data-path="../chapter-11/forge-extension/other-format.html">
            
                <a href="../chapter-11/forge-extension/other-format.html">
            
                    
                    11.6.2 其他格式的模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.11.6.3" data-path="../chapter-11/forge-extension/fast-tesr.html">
            
                <a href="../chapter-11/forge-extension/fast-tesr.html">
            
                    
                    11.6.3 FastTESR
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.11.6.4" data-path="../chapter-11/forge-extension/animation.html">
            
                <a href="../chapter-11/forge-extension/animation.html">
            
                    
                    11.6.4 动画状态机
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.11.6.5" data-path="../chapter-11/forge-extension/teisr.html">
            
                <a href="../chapter-11/forge-extension/teisr.html">
            
                    
                    11.6.5 TileEntityItemStackRenderer
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.12" data-path="../chapter-12/">
            
                <a href="../chapter-12/">
            
                    
                    12. 药水与状态效果
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.12.1" data-path="../chapter-12/potion.html">
            
                <a href="../chapter-12/potion.html">
            
                    
                    12.1 状态效果
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.12.2" data-path="../chapter-12/attributes-modifier.html">
            
                <a href="../chapter-12/attributes-modifier.html">
            
                    
                    12.2 状态效果与属性修饰符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.12.3" data-path="../chapter-12/potion-type.html">
            
                <a href="../chapter-12/potion-type.html">
            
                    
                    12.3 药水类型
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.13" data-path="../chapter-13/">
            
                <a href="../chapter-13/">
            
                    
                    13. 国际化与本地化
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.13.1" data-path="../chapter-13/text-component.html">
            
                <a href="../chapter-13/text-component.html">
            
                    
                    13.1 文本组件（ITextComponent）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="3.14" data-path="./">
            
                <a href="./">
            
                    
                    14. 用户交互界面（GUI）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.15" data-path="../chapter-15/">
            
                <a href="../chapter-15/">
            
                    
                    15. 音效控制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.16" data-path="../chapter-16/">
            
                <a href="../chapter-16/">
            
                    
                    16. 粒子效果
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.17" data-path="../chapter-17/">
            
                <a href="../chapter-17/">
            
                    
                    17. 资源包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.18" data-path="../chapter-18/">
            
                <a href="../chapter-18/">
            
                    
                    18. 用户输入
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.18.1" data-path="../chapter-18/keyboard.html">
            
                <a href="../chapter-18/keyboard.html">
            
                    
                    18.1 键盘输入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.18.2" data-path="../chapter-18/mouse.html">
            
                <a href="../chapter-18/mouse.html">
            
                    
                    18.2 鼠标输入
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.19" data-path="../chapter-19/">
            
                <a href="../chapter-19/">
            
                    
                    19. 世界生成与新维度
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.19.1" data-path="../chapter-19/world-gen-feature/">
            
                <a href="../chapter-19/world-gen-feature/">
            
                    
                    19.1 地图特性（Feature）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.19.1.1" data-path="../chapter-19/world-gen-feature/ore.html">
            
                <a href="../chapter-19/world-gen-feature/ore.html">
            
                    
                    19.1.1 矿石生成
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.19.2" data-path="../chapter-19/biome/index.md">
            
                <span>
            
                    
                    19.2 生物群系（Biome）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.19.2.1" data-path="../chapter-19/biome/feature.md">
            
                <span>
            
                    
                    19.2.1 复用地图特性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.19.2.2" data-path="../chapter-19/biome/decorator.md">
            
                <span>
            
                    
                    19.2.2 生物群系装饰器（Decorator）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.19.2.3" data-path="../chapter-19/biome/natural-spawn.md">
            
                <span>
            
                    
                    19.2.3 刷新生物
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.19.2.4" data-path="../chapter-19/biome/flower-entry.md">
            
                <span>
            
                    
                    19.2.3 附加篇：关于骨粉
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.19.3" data-path="../chapter-19/structure/index.md">
            
                <span>
            
                    
                    19.3 大型结构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.19.3.1" data-path="../chapter-19/structure/base.md">
            
                <span>
            
                    
                    19.3.1 MapGenBase
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.19.3.2" data-path="../chapter-19/structure/structure.md">
            
                <span>
            
                    
                    19.3.2 MapGenStructure
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.19.3.3" data-path="../chapter-19/structure/template.md">
            
                <span>
            
                    
                    19.3.3 Template
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.19.4" data-path="../chapter-19/dimension/index.md">
            
                <span>
            
                    
                    19.4 新维度
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.19.4.1" data-path="../chapter-19/dimension/type.md">
            
                <span>
            
                    
                    19.4.1  可选的 WorldType
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.19.4.2" data-path="../chapter-19/dimension/dimension.md">
            
                <span>
            
                    
                    19.4.2 WorldProvider
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.19.4.3" data-path="../chapter-19/dimension/chunk-gen.md">
            
                <span>
            
                    
                    19.4.3 IChunkGenerator
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.19.4.4" data-path="../chapter-19/dimension/biome-gen.md">
            
                <span>
            
                    
                    19.4.4 BiomeProvider
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.20" data-path="../chapter-20/">
            
                <a href="../chapter-20/">
            
                    
                    20. 村庄
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.20.1" data-path="../chapter-20/villager-profession.html">
            
                <a href="../chapter-20/villager-profession.html">
            
                    
                    20.1 村民职业
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.20.2" data-path="../chapter-20/village-structure.md">
            
                <span>
            
                    
                    20.2 村庄结构
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.21" data-path="../chapter-21/">
            
                <a href="../chapter-21/">
            
                    
                    21. 合成表
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.21.1" data-path="../chapter-21/forge-extension/">
            
                <a href="../chapter-21/forge-extension/">
            
                    
                    21.1 Forge 的扩展
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.21.1.1" data-path="../chapter-21/forge-extension/ore-dictionary.html">
            
                <a href="../chapter-21/forge-extension/ore-dictionary.html">
            
                    
                    21.1.1 矿物词典（Ore Dictionary）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.21.1.2" data-path="../chapter-21/forge-extension/condition.html">
            
                <a href="../chapter-21/forge-extension/condition.html">
            
                    
                    21.1.2 IConditionFactory
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.21.1.3" data-path="../chapter-21/forge-extension/ingredient-factory.html">
            
                <a href="../chapter-21/forge-extension/ingredient-factory.html">
            
                    
                    21.1.3 IIngredientFactory
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.21.1.4" data-path="../chapter-21/forge-extension/recipe-factory.html">
            
                <a href="../chapter-21/forge-extension/recipe-factory.html">
            
                    
                    21.1.4 IRecipeFactory
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.21.1.5" data-path="../chapter-21/forge-extension/constants.html">
            
                <a href="../chapter-21/forge-extension/constants.html">
            
                    
                    21.1.5 常量池（_constants.json）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.21.2" data-path="../chapter-21/custom-recipe.md">
            
                <span>
            
                    
                    21.2 重新实现 IRecipe
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.21.3" data-path="../chapter-21/vanilla-furnace.html">
            
                <a href="../chapter-21/vanilla-furnace.html">
            
                    
                    21.3 扩展篇：熔炉配方及燃料值
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.21.4" data-path="../chapter-21/vanilla-brewing-stand.html">
            
                <a href="../chapter-21/vanilla-brewing-stand.html">
            
                    
                    21.4 扩展篇：酿造台配方
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.21.5" data-path="../chapter-21/forge-extension/anvil-events.html">
            
                <a href="../chapter-21/forge-extension/anvil-events.html">
            
                    
                    21.5 扩展篇：铁砧“配方”
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.22" data-path="../chapter-22/">
            
                <a href="../chapter-22/">
            
                    
                    22. 进度（Advancement）
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.22.1" data-path="../chapter-22/forge-extension/custom-criterion.html">
            
                <a href="../chapter-22/forge-extension/custom-criterion.html">
            
                    
                    22.1 自定义进度触发条件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.22.2" data-path="../chapter-22/forge-extension/custom-item-predicates.html">
            
                <a href="../chapter-22/forge-extension/custom-item-predicates.html">
            
                    
                    22.2 自定义 Item Predicate
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.23" data-path="../chapter-23/">
            
                <a href="../chapter-23/">
            
                    
                    23. 战利品表
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.23.1" data-path="../chapter-23/condition.html">
            
                <a href="../chapter-23/condition.html">
            
                    
                    23.1 战利品表条件（Loot Condition）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.23.2" data-path="../chapter-23/function.html">
            
                <a href="../chapter-23/function.html">
            
                    
                    23.2 战利品表函数（Loot Function）
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.24" data-path="../chapter-24/">
            
                <a href="../chapter-24/">
            
                    
                    24. 命令
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.24.1" data-path="../chapter-24/function.html">
            
                <a href="../chapter-24/function.html">
            
                    
                    24.1 函数（.mcfunction）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.24.2" data-path="../chapter-24/command-tree.html">
            
                <a href="../chapter-24/command-tree.html">
            
                    
                    24.2 Forge 的扩展：CommandTreeBase
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.25" data-path="../chapter-25/">
            
                <a href="../chapter-25/">
            
                    
                    25. Forge 权限系统
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.25.1" data-path="../chapter-25/permission-handler.html">
            
                <a href="../chapter-25/permission-handler.html">
            
                    
                    25.1 IPermissionHandler
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.26" data-path="../chapter-26/">
            
                <a href="../chapter-26/">
            
                    
                    26. Forge 配置文件系统
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.26.1" data-path="../chapter-26/config-gui.html">
            
                <a href="../chapter-26/config-gui.html">
            
                    
                    26.1 Forge 可视化配置文件编辑界面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.26.2" data-path="../chapter-25/raw-config.md">
            
                <span>
            
                    
                    26.2 Configuration 类
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.27" data-path="../chapter-27/">
            
                <a href="../chapter-27/">
            
                    
                    27. Forge 流体系统
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.27.1" data-path="../chapter-27/fluid-stack.html">
            
                <a href="../chapter-27/fluid-stack.html">
            
                    
                    27.1 Fluid 与 FluidStack
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.27.2" data-path="../chapter-27/block.html">
            
                <a href="../chapter-27/block.html">
            
                    
                    27.2 流体方块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.27.3" data-path="../chapter-27/container/">
            
                <a href="../chapter-27/container/">
            
                    
                    27.3 流体容器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.27.3.1" data-path="../chapter-27/container/item.html">
            
                <a href="../chapter-27/container/item.html">
            
                    
                    27.3.1 物品形式的容器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.27.3.2" data-path="../chapter-27/container/block.html">
            
                <a href="../chapter-27/container/block.html">
            
                    
                    27.3.2 方块形式的容器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.27.3.3" data-path="../chapter-27/container/interaction.html">
            
                <a href="../chapter-27/container/interaction.html">
            
                    
                    27.3.3 流体容器之间的交互
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.28" data-path="../chapter-28/">
            
                <a href="../chapter-28/">
            
                    
                    28. Forge Capability 系统
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.28.1" data-path="../chapter-28/built-in/">
            
                <a href="../chapter-28/built-in/">
            
                    
                    28.1 Forge 内建的 Capability
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.28.1.1" data-path="../chapter-28/built-in/item.html">
            
                <a href="../chapter-28/built-in/item.html">
            
                    
                    28.1.1 IItemHandler
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.28.1.2" data-path="../chapter-28/built-in/fluid.html">
            
                <a href="../chapter-28/built-in/fluid.html">
            
                    
                    28.2.2 IFluidHandler, IFluidHandlerItem
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.28.1.3" data-path="../chapter-28/built-in/energy.html">
            
                <a href="../chapter-28/built-in/energy.html">
            
                    
                    28.2.3 IEnergyStorage
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.28.1.4" data-path="../chapter-28/built-in/animation.html">
            
                <a href="../chapter-28/built-in/animation.html">
            
                    
                    28.2.4 IAnimation
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.28.2" data-path="../chapter-28/custom.md">
            
                <span>
            
                    
                    28.2 属于你自己的第一个 Capability
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.29" data-path="../chapter-29/">
            
                <a href="../chapter-29/">
            
                    
                    29. 跨 Mod 兼容及 Add-on 制作
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.29.1" data-path="../chapter-29/imc.html">
            
                <a href="../chapter-29/imc.html">
            
                    
                    29.1 跨 Mod 通信（Inter-Mod Communication，IMC）
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.29.2" data-path="../chapter-29/foreign-capabilities.html">
            
                <a href="../chapter-29/foreign-capabilities.html">
            
                    
                    29.2 使用第三方 Capability
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.30" >
            
                <span>
            
                    
                    30.
            
                </span>
            

            
        </li>
    

    
        
        <li class="header">附录</li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="../chapter-31/index.md">
            
                <span>
            
                    
                    31. 附录 I：？？？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="../chapter-32/index.md">
            
                <span>
            
                    
                    32. 附录 II：？？？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="../chapter-33/index.md">
            
                <span>
            
                    
                    33. 附录 III：？？？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="../chapter-34/index.md">
            
                <span>
            
                    
                    34. 附录 IV：？？？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="../chapter-35/index.md">
            
                <span>
            
                    
                    35. 附录 V：？？？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="../chapter-36/index.md">
            
                <span>
            
                    
                    36. 附录 VI：？？？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.7" data-path="../chapter-37/index.md">
            
                <span>
            
                    
                    37. 附录 VII：？？？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.8" data-path="../chapter-38/index.md">
            
                <span>
            
                    
                    38. 附录 VIII：？？？
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">实战</li>
        
        
    
        <li class="chapter " data-level="5.1" data-path="../chapter-39/index.md">
            
                <span>
            
                    
                    39. 实战：？？？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="../chapter-40/index.md">
            
                <span>
            
                    
                    40. 实战：？？？
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">后记</li>
        
        
    
        <li class="chapter " data-level="6.1" >
            
                <span>
            
                    
                    后记
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1.1" data-path="../afterword/index.md">
            
                <span>
            
                    
                    跋：《Aboard Harbinger Gunship》
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.1.2" data-path="../afterword/credits.md">
            
                <span>
            
                    
                    写在后面：鸣谢名单
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >14. 用户交互界面（GUI）</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><ul><ul><li><span class="title-icon "></span><a href="#&#x56FE;&#x5F62;&#x5316;&#x7528;&#x6237;&#x4EA4;&#x4E92;&#x754C;&#x9762;"><b>1.1.1. </b>&#x56FE;&#x5F62;&#x5316;&#x7528;&#x6237;&#x4EA4;&#x4E92;&#x754C;&#x9762;</a></li><li><span class="title-icon "></span><a href="#&#x7B2C;&#x4E00;&#x6B65;&#xFF1A;&#x4E3A;&#x4EC0;&#x4E48;&#x8981;&#x6709;-container&#xFF1F;"><b>1.1.2. </b>&#x7B2C;&#x4E00;&#x6B65;&#xFF1A;&#x4E3A;&#x4EC0;&#x4E48;&#x8981;&#x6709; Container&#xFF1F;</a></li><li><span class="title-icon "></span><a href="#&#x4E14;&#x6162;&#xFF01;&#x6211;&#x4E0D;&#x9700;&#x8981;&#x548C;&#x670D;&#x52A1;&#x5668;&#x6253;&#x4EA4;&#x9053;&#x554A;&#xFF01;"><b>1.1.3. </b>&#x4E14;&#x6162;&#xFF01;&#x6211;&#x4E0D;&#x9700;&#x8981;&#x548C;&#x670D;&#x52A1;&#x5668;&#x6253;&#x4EA4;&#x9053;&#x554A;&#xFF01;</a></li><li><span class="title-icon "></span><a href="#&#x7EC4;&#x6210;gui&#x7684;&#x5143;&#x4EF6;-components"><b>1.1.4. </b>&#x7EC4;&#x6210;GUI&#x7684;&#x5143;&#x4EF6; (Components)</a></li><li><span class="title-icon "></span><a href="#&#x90A3;&#x5982;&#x679C;&#x6211;&#x7684;-gui-&#x91CC;&#x8FD8;&#x8981;&#x548C;&#x670D;&#x52A1;&#x5668;&#x6253;&#x4EA4;&#x9053;&#x5462;&#xFF1F;"><b>1.1.5. </b>&#x90A3;&#x5982;&#x679C;&#x6211;&#x7684; GUI &#x91CC;&#x8FD8;&#x8981;&#x548C;&#x670D;&#x52A1;&#x5668;&#x6253;&#x4EA4;&#x9053;&#x5462;&#xFF1F;</a></li><li><span class="title-icon "></span><a href="#&#x7B49;&#x7B49;&#xFF01;&#x6211;&#x600E;&#x4E48;&#x6253;&#x5F00;gui&#xFF1F;"><b>1.1.6. </b>&#x7B49;&#x7B49;&#xFF01;&#x6211;&#x600E;&#x4E48;&#x6253;&#x5F00;GUI&#xFF1F;</a></li></ul></ul></ul></div><a href="#" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h3 id="&#x56FE;&#x5F62;&#x5316;&#x7528;&#x6237;&#x4EA4;&#x4E92;&#x754C;&#x9762;"><a name="&#x56FE;&#x5F62;&#x5316;&#x7528;&#x6237;&#x4EA4;&#x4E92;&#x754C;&#x9762;" class="anchor-navigation-ex-anchor" href="#&#x56FE;&#x5F62;&#x5316;&#x7528;&#x6237;&#x4EA4;&#x4E92;&#x754C;&#x9762;"><i class="fa fa-link" aria-hidden="true"></i></a>1.1.1. &#x56FE;&#x5F62;&#x5316;&#x7528;&#x6237;&#x4EA4;&#x4E92;&#x754C;&#x9762;</h3>
<pre><code class="lang-java"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyContainer</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Container</span> </span>{
}

<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyGui</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">GuiContainer</span> </span>{
}
</code></pre>
<p>&#x8FD9;&#x5C31;&#x662F; Minecraft &#x81EA;&#x5DF1;&#x4F7F;&#x7528;&#x7684; GUI &#x7CFB;&#x7EDF;&#x7684;&#x57FA;&#x7840;&#xFF1A;&#x4E00;&#x4E2A;&#x5BA2;&#x6237;&#x7AEF;&#x663E;&#x793A;&#x7684; <code>GuiContainer</code>&#xFF08;&#x51C6;&#x786E;&#x5730;&#x8BF4;&#xFF0C;&#x5E94;&#x8BE5;&#x662F; <code>GuiScreen</code>&#xFF09;&#xFF0C;&#x4EE5;&#x53CA;&#x53EF;&#x9009;&#x7684; <code>Container</code>&#xFF0C;&#x7528;&#x4E8E;&#x903B;&#x8F91;&#x670D;&#x52A1;&#x5668;&#x3002;</p>
<h3 id="&#x7B2C;&#x4E00;&#x6B65;&#xFF1A;&#x4E3A;&#x4EC0;&#x4E48;&#x8981;&#x6709;-container&#xFF1F;"><a name="&#x7B2C;&#x4E00;&#x6B65;&#xFF1A;&#x4E3A;&#x4EC0;&#x4E48;&#x8981;&#x6709;-container&#xFF1F;" class="anchor-navigation-ex-anchor" href="#&#x7B2C;&#x4E00;&#x6B65;&#xFF1A;&#x4E3A;&#x4EC0;&#x4E48;&#x8981;&#x6709;-container&#xFF1F;"><i class="fa fa-link" aria-hidden="true"></i></a>1.1.2. &#x7B2C;&#x4E00;&#x6B65;&#xFF1A;&#x4E3A;&#x4EC0;&#x4E48;&#x8981;&#x6709; Container&#xFF1F;</h3>
<p>&#x5F53;&#x4E14;&#x4EC5;&#x5F53;&#x4F60;&#x9700;&#x8981;&#x548C;&#x670D;&#x52A1;&#x5668;&#x6253;&#x4EA4;&#x9053;&#x65F6;&#x3002;</p>
<p>&#x6BD4;&#x65B9;&#x8BF4;&#x4E00;&#x4E2A;&#x5DE5;&#x4F5C;&#x53F0;&#x3002;&#x4F60;&#x53EF;&#x4EE5;&#x7528;&#x8FD9;&#x4E2A; GUI &#x5408;&#x6210;&#x4E1C;&#x897F;&#xFF01;&#x6240;&#x4EE5;&#x5FC5;&#x987B;&#x6709;&#x670D;&#x52A1;&#x5668;&#x7AEF;&#x7684;&#x4E1A;&#x52A1;&#x903B;&#x8F91;&#xFF0C;&#x4E0D;&#x7136;&#x4F60;&#x5408;&#x6210;&#x7684;&#x7269;&#x54C1;&#x5168;&#x662F;&#x5BA2;&#x6237;&#x7AEF;&#x7279;&#x6548;&#x4F60;&#x9A97;&#x8C01;&#x5462;&#x4F60;&#x3002;</p>
<p>&#x5C31; Container &#x548C; GuiContainer &#x4E4B;&#x95F4;&#x7684;&#x5173;&#x7CFB;&#xFF0C;ustc-zzzz &#x6709;&#x4E00;&#x5F20;&#x56FE;&#x5F88;&#x597D;&#x7684;&#x5BF9;&#x5176;&#x8FDB;&#x884C;&#x4E86;&#x89E3;&#x91CA;&#xFF1A;</p>
<p><img src="https://fmltutor.ustc-zzzz.net/resources/gui_analysis.png" alt="&#x6211;&#x662F;&#x56FE;"></p>
<p>&#xFF08;&#x5C4F;&#x5E55;&#x524D;&#x7684;&#x8BFB;&#x8005;&#x4F60;&#x8981;&#x662F;&#x76F4;&#x63A5;&#x770B; Markdown &#x6E90;&#x6587;&#x4EF6;&#x7684;&#x8BDD;&#x4F60;&#x5C31;&#x4F1A;&#x53D1;&#x73B0;&#x8FD9;&#x56FE;&#x76F4;&#x63A5;&#x6765;&#x81EA;&#x4ED6;&#x6559;&#x7A0B;&#x2026; &#x51C6;&#x786E;&#x5730;&#x8BF4;&#x662F;3.4.1&#x7684;&#x7B2C;&#x4E00;&#x5F20;&#x63D2;&#x56FE;&#x3002;&#xFF09;<br>&#x867D;&#x7136;&#x4F60;&#x5B8C;&#x5168;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x770B; zzzz &#x7684;&#x6559;&#x7A0B;&#xFF0C;&#x4F46;&#x6211;&#x8FD8;&#x662F;&#x518D;&#x7528;&#x81EA;&#x5DF1;&#x7684;&#x7406;&#x89E3;&#x590D;&#x8FF0;&#x4E00;&#x904D;&#x5427;&#xFF1A;</p>
<ul>
<li>&#x5E8F;&#x53F7; 1 &#x662F;&#x6307;&#x5BA2;&#x6237;&#x7AEF;&#x7684;&#x64CD;&#x4F5C;&#x53D1;&#x5305;&#x81F3;&#x670D;&#x52A1;&#x5668;&#x3002;</li>
<li>&#x5E8F;&#x53F7; 2 &#x662F;&#x6307;&#x5BA2;&#x6237;&#x7AEF;&#x5BF9; Slot &#x7684;&#x64CD;&#x4F5C;&#x7531;&#x5BA2;&#x6237;&#x7AEF;&#x4FA7;&#x7684; Container &#x5B9E;&#x4F8B;&#x4EE3;&#x7406;&#x3002;</li>
<li>&#x5E8F;&#x53F7; 3 &#x662F;&#x6307; Container &#x64CD;&#x4F5C;&#x5B83;&#x63A7;&#x5236;&#x7684; Slot&#x2026;&#x2026;</li>
<li>&#x5E8F;&#x53F7; 4 &#x662F;&#x6307; Slot &#x7684;&#x64CD;&#x4F5C;&#x7ED3;&#x679C;&#x8FD4;&#x56DE;&#x7ED9; Container&#x3002;</li>
<li>&#x5E8F;&#x53F7; 5 &#x662F;&#x6307;&#x670D;&#x52A1;&#x5668;&#x7AEF;&#x7684;&#x4E1A;&#x52A1;&#x53D1;&#x4FE1;&#xFF08;&#x4E71;&#x4E03;&#x516B;&#x7CDF;&#x8BF8;&#x5982;&#x7269;&#x54C1;&#x548C;&#x201C;&#x8FDB;&#x5EA6;&#x6761;&#x201D;&#x8FD9;&#x79CD;&#xFF09;&#x7ED9;&#x5BA2;&#x6237;&#x7AEF;&#x3002;</li>
<li>&#x5E8F;&#x53F7; 6 &#x662F;&#x6307;&#x5BA2;&#x6237;&#x7AEF;&#x7684;&#x64CD;&#x4F5C;&#x90FD;&#x4F1A;&#x901A;&#x77E5;&#x670D;&#x52A1;&#x5668;&#x7AEF;&#x3002;</li>
<li>&#x5B9E;&#x7EBF;&#x662F; Mojang &#x7528;&#x5B83;&#x7684;&#x9ED1;&#x9B54;&#x6CD5;&#x5E2E;&#x4F60;&#x641E;&#x5B9A;&#x4E86;&#x3002;</li>
<li>&#x865A;&#x7EBF;&#x662F; Mojang &#x8868;&#x793A;&#x8FD9;&#x4E2A;&#x4F60;&#x8981;&#x81EA;&#x5DF1;&#x6765;&#x3002;</li>
</ul>
<pre><code class="lang-java"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyContainer</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">Container</span> </span>{
    <span class="hljs-comment">// &#x6B64;&#x65B9;&#x6CD5;&#x5FC5;&#x987B;&#x8986;&#x5199;&#xFF0C;&#x56E0;&#x4E3A;&#x7236;&#x7C7B;&#x91CC;&#x8FD9;&#x662F;&#x4E2A;&#x62BD;&#x8C61;&#x65B9;&#x6CD5;&#x3002;</span>
    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">boolean</span> <span class="hljs-title">canPlayerInteractWith</span><span class="hljs-params">(EntityPlayer player)</span> </span>{
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">true</span>;
        <span class="hljs-comment">// &#x8FD4;&#x56DE; false &#x7684;&#x65F6;&#x5019;&#x4F1A;&#x7ED9;&#x4F60;&#x5173;&#x6389; GUI&#x3002;</span>
    }
}
</code></pre>
<h3 id="&#x4E14;&#x6162;&#xFF01;&#x6211;&#x4E0D;&#x9700;&#x8981;&#x548C;&#x670D;&#x52A1;&#x5668;&#x6253;&#x4EA4;&#x9053;&#x554A;&#xFF01;"><a name="&#x4E14;&#x6162;&#xFF01;&#x6211;&#x4E0D;&#x9700;&#x8981;&#x548C;&#x670D;&#x52A1;&#x5668;&#x6253;&#x4EA4;&#x9053;&#x554A;&#xFF01;" class="anchor-navigation-ex-anchor" href="#&#x4E14;&#x6162;&#xFF01;&#x6211;&#x4E0D;&#x9700;&#x8981;&#x548C;&#x670D;&#x52A1;&#x5668;&#x6253;&#x4EA4;&#x9053;&#x554A;&#xFF01;"><i class="fa fa-link" aria-hidden="true"></i></a>1.1.3. &#x4E14;&#x6162;&#xFF01;&#x6211;&#x4E0D;&#x9700;&#x8981;&#x548C;&#x670D;&#x52A1;&#x5668;&#x6253;&#x4EA4;&#x9053;&#x554A;&#xFF01;</h3>
<p>&#x90A3;&#x5C31;&#x76F4;&#x5954; <code>GuiContainer</code> &#x597D;&#x4E86;&#x3002;&#x60F3;&#x60F3;&#x770B;&#xFF0C;&#x4E00;&#x672C;&#x6E38;&#x620F;&#x5185;&#x7F6E;&#x7684;&#x624B;&#x518C;&#x591A;&#x6570;&#x65F6;&#x5019;&#x4E0D;&#x9700;&#x8981;&#x670D;&#x52A1;&#x5668;&#x7AEF;&#x6709;&#x4EC0;&#x4E48;&#x64CD;&#x4F5C;&#x5427;&#x2026;&#x2026;</p>
<h3 id="&#x7EC4;&#x6210;gui&#x7684;&#x5143;&#x4EF6;-components"><a name="&#x7EC4;&#x6210;gui&#x7684;&#x5143;&#x4EF6;-components" class="anchor-navigation-ex-anchor" href="#&#x7EC4;&#x6210;gui&#x7684;&#x5143;&#x4EF6;-components"><i class="fa fa-link" aria-hidden="true"></i></a>1.1.4. &#x7EC4;&#x6210;GUI&#x7684;&#x5143;&#x4EF6; (Components)</h3>
<p>&#x8BF4;&#x662F;&#x8FD9;&#x4E48;&#x8BF4;&#xFF0C;&#x5176;&#x5B9E;&#x80FD;&#x79F0;&#x5F97;&#x4E0A; Components &#x7684;&#x4E1C;&#x897F;&#x771F;&#x7684;&#x4E0D;&#x591A;&#x3002;</p>
<h4 id="&#x80CC;&#x666F;"><a name="&#x80CC;&#x666F;" class="anchor-navigation-ex-anchor" href="#&#x80CC;&#x666F;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x80CC;&#x666F;</h4>
<h4 id="&#x6587;&#x672C;&#x6846;"><a name="&#x6587;&#x672C;&#x6846;" class="anchor-navigation-ex-anchor" href="#&#x6587;&#x672C;&#x6846;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x6587;&#x672C;&#x6846;</h4>
<p><code>GuiTextField</code></p>
<h4 id="&#x6309;&#x94AE;"><a name="&#x6309;&#x94AE;" class="anchor-navigation-ex-anchor" href="#&#x6309;&#x94AE;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x6309;&#x94AE;</h4>
<p><code>GuiButton</code></p>
<h4 id="&#x6EDA;&#x52A8;&#x83DC;&#x5355;"><a name="&#x6EDA;&#x52A8;&#x83DC;&#x5355;" class="anchor-navigation-ex-anchor" href="#&#x6EDA;&#x52A8;&#x83DC;&#x5355;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x6EDA;&#x52A8;&#x83DC;&#x5355;</h4>
<h4 id="&#x6ED1;&#x5757;"><a name="&#x6ED1;&#x5757;" class="anchor-navigation-ex-anchor" href="#&#x6ED1;&#x5757;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x6ED1;&#x5757;</h4>
<h4 id="&#x52FE;&#x9009;&#x6846;&#x662F;&#x5565;&#x6765;&#x7740;&#xFF1F;"><a name="&#x52FE;&#x9009;&#x6846;&#x662F;&#x5565;&#x6765;&#x7740;&#xFF1F;" class="anchor-navigation-ex-anchor" href="#&#x52FE;&#x9009;&#x6846;&#x662F;&#x5565;&#x6765;&#x7740;&#xFF1F;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x52FE;&#x9009;&#x6846;&#x662F;&#x5565;&#x6765;&#x7740;&#xFF1F;</h4>
<p>&#x4F60;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x6309;&#x94AE;&#x6765;&#x6A21;&#x62DF;&#x52FE;&#x9009;&#x6846;&#x3002;</p>
<h3 id="&#x90A3;&#x5982;&#x679C;&#x6211;&#x7684;-gui-&#x91CC;&#x8FD8;&#x8981;&#x548C;&#x670D;&#x52A1;&#x5668;&#x6253;&#x4EA4;&#x9053;&#x5462;&#xFF1F;"><a name="&#x90A3;&#x5982;&#x679C;&#x6211;&#x7684;-gui-&#x91CC;&#x8FD8;&#x8981;&#x548C;&#x670D;&#x52A1;&#x5668;&#x6253;&#x4EA4;&#x9053;&#x5462;&#xFF1F;" class="anchor-navigation-ex-anchor" href="#&#x90A3;&#x5982;&#x679C;&#x6211;&#x7684;-gui-&#x91CC;&#x8FD8;&#x8981;&#x548C;&#x670D;&#x52A1;&#x5668;&#x6253;&#x4EA4;&#x9053;&#x5462;&#xFF1F;"><i class="fa fa-link" aria-hidden="true"></i></a>1.1.5. &#x90A3;&#x5982;&#x679C;&#x6211;&#x7684; GUI &#x91CC;&#x8FD8;&#x8981;&#x548C;&#x670D;&#x52A1;&#x5668;&#x6253;&#x4EA4;&#x9053;&#x5462;&#xFF1F;</h3>
<p>&#x4F60;&#x9700;&#x8981;&#x4E00;&#x4E2A; <code>Container</code>&#x3002;&#x4E0D;&#x9700;&#x8981;&#x7684;&#x8BDD;&#x4E5F;&#x8BB8;&#x4E5F;&#x53EF;&#x4EE5;&#xFF0C;&#x4F46;&#x662F;&#x5F88;&#x591A;&#x4E8B;&#x60C5;&#x5C31;&#x9700;&#x8981;&#x91CD;&#x65B0;&#x4ECE;&#x96F6;&#x5F00;&#x59CB;&#x5199;&#x3002;</p>
<h3 id="&#x7B49;&#x7B49;&#xFF01;&#x6211;&#x600E;&#x4E48;&#x6253;&#x5F00;gui&#xFF1F;"><a name="&#x7B49;&#x7B49;&#xFF01;&#x6211;&#x600E;&#x4E48;&#x6253;&#x5F00;gui&#xFF1F;" class="anchor-navigation-ex-anchor" href="#&#x7B49;&#x7B49;&#xFF01;&#x6211;&#x600E;&#x4E48;&#x6253;&#x5F00;gui&#xFF1F;"><i class="fa fa-link" aria-hidden="true"></i></a>1.1.6. &#x7B49;&#x7B49;&#xFF01;&#x6211;&#x600E;&#x4E48;&#x6253;&#x5F00;GUI&#xFF1F;</h3>
<pre><code class="lang-java"><span class="hljs-keyword">import</span> javax.annotation.Nullable;
<span class="hljs-keyword">import</span> net.minecraft.entity.player.EntityPlayer;
<span class="hljs-keyword">import</span> net.minecraft.world.World;
<span class="hljs-keyword">import</span> net.minecraftforge.fml.common.network.IGuiHandler;

<span class="hljs-keyword">public</span> <span class="hljs-keyword">enum</span> MyGUIHandler implements IGuiHandler {
    INSTANCE;

    <span class="hljs-function"><span class="hljs-keyword">private</span> <span class="hljs-title">MyGUIHandler</span><span class="hljs-params">()</span> </span>{
        NetworkRegistry.INSTANCE.registerGuiHandler(ExampleMod.instance, <span class="hljs-keyword">this</span>);
    }

    <span class="hljs-meta">@Nullable</span> <span class="hljs-comment">//&#x611F;&#x8C22; mezz &#x7684; MinecraftForge/MinecraftForge#3550</span>
    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Object <span class="hljs-title">getServerGuiElement</span><span class="hljs-params">(<span class="hljs-keyword">int</span> ID, EntityPlayer player, World world, <span class="hljs-keyword">int</span> x, <span class="hljs-keyword">int</span> y, <span class="hljs-keyword">int</span> z)</span> </span>{
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">null</span>;
    }
    <span class="hljs-meta">@Nullable</span> <span class="hljs-comment">//&#x611F;&#x8C22; mezz &#x7684; MinecraftForge/MinecraftForge#3550</span>
    <span class="hljs-meta">@Override</span>
    <span class="hljs-function"><span class="hljs-keyword">public</span> Object <span class="hljs-title">getClientGuiElement</span><span class="hljs-params">(<span class="hljs-keyword">int</span> ID, EntityPlayer player, World world, <span class="hljs-keyword">int</span> x, <span class="hljs-keyword">int</span> y, <span class="hljs-keyword">int</span> z)</span> </span>{
        <span class="hljs-keyword">return</span> <span class="hljs-keyword">null</span>;
    }
}
</code></pre>
<p>&#x4EE5;&#x53CA;&#x53D1;&#x6325;&#x70B9;&#x60F3;&#x8C61;&#x529B;&#x3002;&#x5E76;&#x975E;&#x53EA;&#x6709;ID&#x53EF;&#x4EE5;&#x5B58;&#x50A8;&#x6570;&#x636E;&#xFF0C;&#x6700;&#x540E;&#x7684;&#x4E09;&#x4E2A; <code>x</code>&#x3001;<code>y</code>&#x3001;<code>z</code> &#x5E76;&#x975E;&#x603B;&#x662F;&#x5750;&#x6807;&#x2014;&#x2014;&#x5B83;&#x4EEC;&#x4E5F;&#x662F;&#x53EF;&#x4EE5;&#x62FF;&#x6765;&#x5B58;&#x50A8;&#x6570;&#x636E;&#x7684;&#x3002;&#x6362;&#x8A00;&#x4E4B;&#xFF0C;&#x4F60;&#x5728;&#x8FD4;&#x56DE;&#x5BF9;&#x5E94;&#x7684; GUI &#x5BF9;&#x8C61;&#x65F6;&#x6700;&#x591A;&#x53EF;&#x4EE5;&#x7528;&#x5230; 4 &#x4E2A;&#x6574;&#x6570;&#x7684;&#x4FE1;&#x606F;&#xFF08;&#x603B;&#x957F;&#x5EA6;128 bit&#xFF09;&#x6765;&#x786E;&#x5B9A;&#x5E94;&#x8BE5;&#x6253;&#x5F00;&#x54EA;&#x4E2A; GUI&#x2026;&#x2026; <a href="https://github.com/MinecraftForge/MinecraftForge/issues/3228" target="_blank">&#x53C2;&#x8003;MinecraftForge/MinecraftForge#3228</a>&#x3002;<br>&#x6700;&#x540E;&#x53EA;&#x9700;&#x8981;&#x5728;&#x6709; EntityPlayer &#x7684;&#x5730;&#x65B9;&#x8FD9;&#x4E48;&#x505A;&#xFF1A;</p>
<pre><code class="lang-java"><span class="hljs-comment">//playerIn&#x662F;&#x4E2A;EntityPlayer</span>
<span class="hljs-comment">//5&#x4E0D;&#x662F;arbitary number&#xFF0C;&#x662F;&#x4E0A;&#x9762;IGuiHandler&#x4E2D;&#x7684;id&#xFF0C;&#x5177;&#x4F53;&#x542B;&#x4E49;&#x7531;&#x5B9E;&#x73B0;&#x51B3;&#x5B9A;</span>
<span class="hljs-comment">//worldIn&#x662F;&#x4E2A;World</span>
<span class="hljs-comment">//&#x6700;&#x540E;&#x7684;&#x4E09;&#x4E2A;xyz&#x6CA1;&#x6709;&#x5F3A;&#x5236;&#x8981;&#x6C42;&#x662F;&#x5750;&#x6807;&#xFF0C;&#x53EF;&#x7528;&#x4E8E;&#x4F20;&#x5165;&#x522B;&#x7684;&#x6570;&#x636E;</span>
playerIn.openGui(ExampleMod.instance, <span class="hljs-number">5</span>, worldIn, pos.getX(), pos.getY(), pos.getZ());
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../chapter-13/text-component.html" class="navigation navigation-prev " aria-label="Previous page: 13.1 文本组件（ITextComponent）">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../chapter-15/" class="navigation navigation-next " aria-label="Next page: 15. 音效控制">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"14. 用户交互界面（GUI）","level":"3.14","depth":1,"next":{"title":"15. 音效控制","level":"3.15","depth":1,"path":"chapter-15/index.md","ref":"chapter-15/index.md","articles":[]},"previous":{"title":"13.1 文本组件（ITextComponent）","level":"3.13.1","depth":2,"path":"chapter-13/text-component.md","ref":"chapter-13/text-component.md","articles":[]},"dir":"ltr"},"config":{"plugins":["katex","splitter","expandable-chapters","anchor-navigation-ex"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"splitter":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"flow":{"line-color":"red"},"katex":{},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":true,"showLevel":true},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{}},"theme":"default","author":"https://github.com/TeamCovertDragon/Harbinger/graphs/contributors","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Harbinger","gitbook":"*","description":"Just Another FMLTutor For Future"},"file":{"path":"chapter-14/index.md","mtime":"2019-08-01T09:51:56.555Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-08-01T10:14:55.065Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

